package com.rst.dao;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.rst.model.Section;

@Repository
@Transactional
public class SectionDAO {

	@Autowired
	private SessionFactory sessionFactory;


	public void udateSections(Section section) {
		sessionFactory.getCurrentSession().update(section);
	}

	public Long saveSection(Section section) {
		return (Long) sessionFactory.getCurrentSession().save(section);	
		}

	public Section getSectionById(Long sectionId) {
	    Session session = sessionFactory.getCurrentSession();
	    Section section = (Section)session.get(Section.class, sectionId);
		return section;
	}

	public List<Section> getSectionList() {
		// TODO Auto-generated method stub
		return null;
	}
}




